
#include "HTTP_Util.h"

template<class T>
int HTTP_Util<T>::http_package(char* a_result, char* a_data)
{
    int status = 0;
    
    //int _datalength = sizeof(a_data);
    //int _alllength = 4096;
    //char _htto_head[] = "192.168.1.200\r\n";
    char _http_method[] = "HEAD / HTTP/1.1\r\n";
    char _http_host[] = "Host: 192.168.1.200\r\n";
    //char _http_useragent[] = "User-Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.113 Safari/535.19\r\n";
    //char _http_accept[] = "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n";
    //char _http_encoding[] = "Accept-Encoding: gzip, deflate\r\n";
    //char _http_vary[] = "Vary: Accept-Encoding\r\n";
    //char _http_contenttype[] = "Content-Type: text/html; charset=utf-8\r\n";
    //char _http_contentlength[] = "Content-Length: 155\r\n";
    
    //strncat(a_result, _htto_head, sizeof(_htto_head));
    strncat(a_result, _http_method, sizeof(_http_method));
    strncat(a_result, _http_host, sizeof(_http_host));
    //strncat(a_result, _http_useragent, sizeof(_http_useragent));
    //strncat(a_result, _http_accept, sizeof(_http_accept));
    //strncat(a_result, _http_vary, sizeof(_http_vary));
    //strncat(a_result, _http_encoding, sizeof(_http_encoding));
    //strncat(a_result, _http_referer, sizeof(_http_referer));
    //strncat(a_result, _http_contenttype, sizeof(_http_contenttype));
    //strncat(a_result, _http_contentlength, sizeof(_http_contentlength));
    
    strncat(a_result, a_data, sizeof(a_data));
    
    return status;
}




